package com.cl.cloud.binlog.runner;

import com.cl.cloud.binlog.content.BinLogApplicationContext;
import com.cl.cloud.binlog.properties.BinLogProperty;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @description:
 * @author: liuzijian
 * @time: 2022-07-08 16:03
 */
@Slf4j
@AllArgsConstructor
public class ContextInitRunner implements CommandLineRunner {


    private final BinLogProperty property;
    private final BinLogApplicationContext context;


    @Override
    public void run(String... args) throws Exception {
        if(property.isEnable()){
            context.init();
        }
    }
}
